This page last changed on Jul 24, 2007 by cholmes.

Introduction

We at the GeoServer project would love to see GeoServer available in every language, to become a truely world wide application. We feel one of the main benefits of Open Source is its ability to be customized, and therefor we try to make GeoServer as easy to internationalize as possible. Right now we just have the application translated to French, and the documentation translated to Spanish. This document is going to focus on what is potentially the biggest bang for the buck in internationalization - translating the web administration application. We currently have translations for French, Spanish, Portuguese, German, Japanese and Chinese, and are always looking for more.

Instructions

The GeoServer web administration interface was written on STRUTS , which has a strong focus on what they lovingly refer to as i18n (internationalization, the 18 referring to the number of letters between i and n). For a decent page on how to go about i18n in struts see here . Most of that document need not concern you as a translator, however, as we've done most of the work. All that you need to do is create an appropriate Applications Resources file for your language. ApplicationResources.properties is the main GeoServer english definitions, all the strings used in the web administration interface are defined there. For another language you just need to define them with the translations. The file is found in the WEB-INF/ folder, in the source release it is in geoserver/web/src/main/java, and in a binary distribution it is in GEOSERVER_HOME/webapps/geoserver/WEB-INF. Using either should be fine. To see a sample translation there should be a ApplicationResources_fr.properties in all geoserver downloads. French users should notice that when they use geoserver the messages are in french. STRUTS detects the language settings, so this should all happen seamlessly. To define a new language you just make a properties file with the appropriate two letter ISO language code. So Spanish would define it in a file called ApplicationResources_es.properties Once the file is defined the next start up should pick up the changes, as long as the language is defined correctly. If it does not find the file it defaults to english.

Once you have the language defined, we would love it if you would contribute it to GeoServer so other users can also use it. And we can also get you commit rights to maintain it yourself, so you don't have to email whenever we happen to change a message. For more directions on this see Maintaining Translations.

Thanks for contributing to GeoServer!

When using the GeoServer web administration, the client browser sends to the server its preferred language (when none defined, it's the browser's "native" language). The STRUTS machinery behind the scene interprets this language by looking after the ApplicationResources_"lang".properties. If that file is missing, STRUTS takes the default server-side language through the ApplicationResources.properties file. There is nothing saying that this file is in english for STRUTS : it is just the default language ! Under Linux, I use to make a symbolic link to indicate what is the default language :
$ ln -s ApplicationResources.properties ApplicationResources_en.properties

Once this stated, the next question is : what is a language for STRUTS ?
As Chris stated it is usually an 2 letter ISO language code (e. g. en, fr, es, etc.). But, it could also be : en_EN, en_UK, en_US, fr_FR, fr_CA, etc. When the client browser sends the prefered language, STRUTS tries to find ApplicationResources_"language".properties. If not found and the language is not a 2 letter ISO language code, STRUTS tries the first two characters of the sent language, then if it fails, it is the default file that is used !
Finally, we can have for a language "la" :
ApplicationResources_la.properties
ApplicationResources_la_LA.properties
or any other "dialect" : ApplicationResources_la_AL.properties.

For fun, knowing that (for the time of this writting) GeoServer handles english and french, add fr (or any fr_something combinaison) as on of the prefered languages of your browser and make it the default one, point at the geoserver web administration interface : it is in french ! Change back to your language : it is back in english !

Posted by dgricci at Nov 09, 2004 17:26
Document generated by Confluence on Jan 16, 2008 23:26